#ifndef DVSYNONYMSDIALOG_H
#define DVSYNONYMSDIALOG_H

#include <QDialog>
#include "dvDatabaseController.h"
#include "dvDatabaseControllerUsable.h"

namespace Ui {
class dvSynonymsDialog;
}

class dvSynonymsDialog : public QDialog, public dvDatabaseControllerUsable
{
    Q_OBJECT
    
public:
    explicit dvSynonymsDialog(QWidget *parent = 0);
    ~dvSynonymsDialog();
    void Initialize();
    inline void setMapId(int id){ m_map = id; }
    inline int  mapId(){ return m_map; }
    
private:
    Ui::dvSynonymsDialog *ui;
    int     m_map;
    QTableView     *m_pTable;
    QSqlQueryModel *m_pModel;
    QComboBox      *m_pMapsList;
    QComboBox      *m_pRegonsList;

    void fillTable(QSqlQuery *query);

private slots:
    void clickedAdd();
    void clickedDelete();
    void clickedEdit();
    void clickedOk();
    void clickedCancel();
    void currentMapChanged(int index);
    void currentRegionChanged(int index);
};

#endif // DVSYNONYMSDIALOG_H
